package com.alangyun.remind.repository.mapping;

import java.io.Serializable;
import java.util.Date;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("dataset")
public class DatasetFile implements Serializable {

	/** 数据集的识别码 * */
	@XStreamAlias("name")
	@XStreamAsAttribute
	private String key;
	/** 最后更新时间 * */
	@XStreamAlias("modifytime")
	@XStreamAsAttribute
	private Date lastModify;
	/** 最新使用的数据文件名 * */
	@XStreamAlias("current-file")
	private String latest;
	/** 历史文件 * */
	@XStreamAlias("histories")
	private DatasetHistory histories;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getLatest() {
		return latest;
	}

	public void setLatest(String latest) {
		this.latest = latest;
	}

	public Date getLastModify() {
		return lastModify;
	}

	public void setLastModify(Date lastModify) {
		this.lastModify = lastModify;
	}

	public DatasetHistory getHistories() {
		return histories;
	}

	public void setHistories(DatasetHistory histories) {
		this.histories = histories;
	}

	public static DatasetFile create(String key) {
		DatasetFile ret = new DatasetFile();
		ret.key = key;
		ret.lastModify= new Date();
		ret.histories = new DatasetHistory();
		
		return ret;
	}
}
